<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix = "c"  uri = "http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html lang="en-US">
  <head>
    <link rel="stylesheet" type="text/css"  href="css/bootstrap.min.css"/>
	<title>凯胜项目管理系统</title>
	<style type="text/css">
		body{
			padding-top:60px;
		}
	</style>
  </head>
  
  <body class="body">
	<%@include file="same2.jsp" %>
	<div class="container">
		<div class="row">
			<%@include file="same.jsp" %>
			<div class="span9">
			<c:choose>
				<c:when test="${sessionScope.userProject.role=='manager'}">
					<div class="btn-group" style="float:right">
						<a class="btn btn-primary" href="#"><i class="icon-cog icon-white"></i>操作</a>
						<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
						<ul class="dropdown-menu" id="dropdown-menu">
							<li><a href="goal.jspx?pmothed=new"><i class="icon-plus "></i>添加新目标</a></li>
							<li><a href="goal.jspx?pmothed=alltask"><i class="icon-zoom-in"></i>浏览所有任务</a></li>
						</ul>
					</div>
				</c:when>
				<c:otherwise>
					<div class="btn-group" style="float:right">
							<a class="btn btn-primary"  href="goal.jspx?pmothed=mytask"><i class="icon-zoom-in"></i>浏览我的所有任务</a>
					</div>
				</c:otherwise>
			</c:choose>
				<div class="clear" ></div>
				<c:choose>
					<c:when test="${empty requestScope.goalProgressList}">
						<div class="well" style="height:30px;border-top:none; border:1px solid #dddddd;margin-top:50px; ">
							<p style="margin-left:150px">该项目还没有建立任何目标</p>
						</div>
					</c:when>
					<c:otherwise>
					<div style="margin-top:40px">
							<c:forEach items = "${requestScope.goalProgressList}" var = "goalProgress">
								 <ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:10px">
									<li >
										<a href="task.jspx?id=${goalProgress.goal.id}&progress=${goalProgress.progress}"><i class="icon-th"></i>${goalProgress.goal.gname}</a>
									</li>
									<li style="float:right">
										<c:choose>
											<c:when test="${sessionScope.userProject.role=='manager'}">
												<a style="margin-right:15px;" href="goal.jspx?pmothed=delgoal&id=${goalProgress.goal.id}" class="link-black"><i class="icon-trash"></i>删除</a>
												<a href="goal.jspx?pmothed=edit&id=${goalProgress.goal.id}" class="link-black"><i class="icon-edit"></i>编辑</a>
											</c:when>
											<c:otherwise>
											
											</c:otherwise>
										</c:choose>
									</li>
								</ul>
								<c:choose>
									<c:when test="${goalProgress.progress>50}">
										<div class="wall" style="border-top:none; border:1px solid #dddddd ">
											<p style="margin:15px">${goalProgress.goal.gdescription}</p>
											<div class="progress progress-success"style="width:90%;color:red; margin-left:20px">
												<div class="bar" style="width: ${goalProgress.progress}%;color:white;text-align:center">已完成${goalProgress.progress}%</div>
											</div>
										</div>
									</c:when>
									<c:otherwise>
									<div class="wall" style="border-top:none; border:1px solid #dddddd ">
											<p style="margin:15px">${goalProgress.goal.gdescription}</p>
											<div class="progress "style="width:90%;color:red; margin-left:20px">
												<div class="bar" style="width: ${goalProgress.progress}%;color:white;text-align:center">已完成${goalProgress.progress}%</div>
											</div>
										</div>
									</c:otherwise>
								</c:choose>
							</c:forEach>
						</div>
					</c:otherwise>
				</c:choose>
			
			</div>
		</div>
	</div>
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#myid li").eq(3).addClass("active");
			$("#myid i").eq(1).addClass("  icon-white");
			$(".btn dropdown-toggle").click(function(){
				$("#dropdown-toggle").dropdown();
			});
		});
		
	</script>	
</body>
</html>
